local skel = fk.CreateSkill {
  name = "emo__zhuojin_active",
}

skel:addEffect("viewas", {
  card_num = 2,
  interaction = function (self, player)
    local all_names = Fk:getAllCardNames("t")
    if player:getMark("emo__zhuojin_slash-round") == 0 then
      table.insert(all_names, 1, "slash")
    end
    local mark = player:getTableMark("emo__zhuojin_used")
    local names = player:getViewAsCardNames("emo__zhuojin", all_names, nil, mark)
    if #names > 0 then
      return UI.CardNameBox { choices = names, all_names = all_names }
    end
  end,
  card_filter = function (self, player, to_select, selected)
    return #selected < 2 and table.contains(player.player_cards[Player.Hand], to_select)
    and not player:prohibitDiscard(Fk:getCardById(to_select))
  end,
  view_as = function (self, player, cards)
    if #cards ~= 2 or not self.interaction.data then return nil end
    local c = Fk:cloneCard(self.interaction.data)
    c.skillName = "emo__zhuojin"
    return c
  end,
})

return skel
